﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SocketLibs;
using System.Threading;

namespace MCdirectHostWebform
{
	public partial class MainForm : Form
	{
		public MainForm()
		{
			InitializeComponent();
			InitOther();
		}

		void DoForItems() 
		{
			for (int i = 0; i < 10; i++)
			{
				UctrlStoryItem item = new UctrlStoryItem();
				flowLayoutPanel1.Controls.Add(item);
			}
		}


		private SocketListener Listener = new SocketListener(1199);

		void InitOther() 
		{
			this.Listener.SignHandler += new ClientSignHandler(Listener_SignHandler);
			this.Listener.MessageHandler += new ServerMessageHandler(Listener_MessageHandler);
			this.Listener.ActHandler += new ServerActHandler(Listener_ActHandler);
		}

		void Listener_ActHandler(object sender, ServerActEventArgs e)
		{
			
		}

		void Listener_MessageHandler(object sender, ServerMessageEventArgs e)
		{
			
		}

		void Listener_SignHandler(object sender, ClientSignEventArgs e)
		{
			
		}

		private void BtnStart_Click(object sender, EventArgs e)
		{
			Thread t = new Thread(new ThreadStart(this.Listener.Start));
			t.Start();
		}

		private void BtnStop_Click(object sender, EventArgs e)
		{
			this.Listener.Stop();
		}
	}
}
